import * as util from "@/common/util";
import * as API from "@/api/axios";

export default {
    // 获取交易记录
    getPage: (params, page) => {
        const url = util.replacePageNumAndSize('/manage/transfers/record/{pageNum}/{pageSize}', page)
        return API.axiosGetAPI(url, params)
    },
    // 获取交易统计数据
    getTotal: (params) => {
        return API.axiosGetAPI(`/manage/transfers/record/getRecordStatisticsData`, params)
    },

    // 获取用户交易记录-导出
    getExportTransfers: (params) => {
        const headers = {
            'content-Type': 'application/x-www-form-urlencoded',
            'lang-key': 'exports'
        }
        return API.axiosPostAPI(`/manage/transfers/export?dealType=${params.dealType}&paymentMethod=${params.paymentMethod}&rangeTime=${params.rangeTime}&search=${params.search}&variableTitleHead=${params.variableTitleHead}`, null, headers, {
            responseType: 'blob'
        });
    },
}